#ifndef MYGLWIDGET_H
#define MYGLWIDGET_H

#include <QtOpenGL>
#include "mygl/triangulo.h"
#include "mygl/pilat.h"
/**
 * Customization of QGLWidget.
 *
 * QGLWidget is the default widget to display graphics through OpenGL. This class is a simple
 * customization that includes some basic configurations to ease the beginning of an OpenGL project.
 * @see http://doc.trolltech.com/4.5/qglwidget.html
 */
class MyGLWidget : public QGLWidget
{
        Q_OBJECT

public:
        // Constructor.
        MyGLWidget(QWidget *parent);
        // Destructor.
        virtual ~MyGLWidget();
        PilaT* p;
        PilaT* p2;
        pilaSend* ps;
        pilaSend* ps2;
        float zoom;
        float sep;
signals:
        // Emitted when I want to paint something.
        void painting();

public slots:
         void refinar1();
         void refinar2();
         void sincronizar1();
         void sincronizar2();
         void separar();
         void unir();
         void printToFile();
protected:
        // Called once before the first call to paintGL() or resizeGL().
        // This method should set up any required OpenGL context rendering flags, etc.
        void initializeGL();
        // Called whenever the widget needs to be painted.
        // Here all the glBegin/glEnd blocks must be or be called.
        // If you want to repaint the widget, *DO NOT* call this method, call updateGL instead.
        void paintGL();
        // Called whenever the widget has been resized. The new size is passed in width and height.
        // This method should reset the camera given the new width and height.
        void resizeGL(int width, int height);

        // Methods for user interaction:
        //void keyPressEvent(QKeyEvent *event);
        //void keyReleaseEvent(QKeyEvent *event);
        //void mouseMoveEvent(QMouseEvent *event);
        //void mousePressEvent(QMouseEvent *event);
        //void mouseReleaseEvent(QMouseEvent *event);

};

#endif // MYGLWIDGET_H
